package com.mmall.concurrency.threads.yield;

public class DemoTest1 extends Thread {
    @Override
    public void run() {
        Long start = System.currentTimeMillis();
        int count = 0;
        for (int i = 1; i <= 10000000; i++) {
            count = count + i;
        }
        Long end = System.currentTimeMillis();
        System.out.println("总执行时间： "+ (end-start) + " 毫秒, 结果 count = " + count);
    }

    public static void main(String[] args) throws InterruptedException {
        DemoTest1 threadOne = new DemoTest1();
        threadOne. start();
    }
}
